//
//  Book.m
//  17--SandBox
//
//  Created by 冀永金 on 16/8/5.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "Book.h"

@implementation Book
// 取值
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        _bookName = [aDecoder decodeObjectForKey:@"booName"];
        _bookPrice = [aDecoder decodeObjectForKey:@"bookPrice"];
        _bookAuthor = [aDecoder decodeObjectForKey:@"bookAuthor"];
    }
    return self;
}
// 赋值 ，存储
- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_bookName forKey:@"booName"];
    [aCoder encodeObject:_bookPrice forKey:@"bookPrice"];
    [aCoder encodeObject:_bookAuthor forKey:@"bookAuthor"];
}

@end
